﻿using System;
using System.Threading.Tasks;
using battlenet.wow.rt.domain.objects;
using battlenet.wow.rt.sdk.data.dto;
using battlenet.wow.rt.sdk.objects.mapper;

namespace battlenet.wow.rt.sdk.Data.Proxy
{
    internal class AuctionHouseProxy : BattlenetApiProxy<AuctionStatusInfo>
    {
        /// <summary>
        /// Gets the auction house files asynchronous.
        /// </summary>
        /// <param name="realm">The realm.</param>
        /// <returns></returns>
        public async Task<AuctionHouseFileCollection> GetAuctionHouseFilesAsync(string realm)
        {
            var resource = string.Format(BattlenetApiResource.AuctionHouseData, realm);
            var response = await RequestDataAsync(resource);
            return response.Remap(new AuctionHouseFileCollectionMapper());
        }
    }
}